import { IsString, IsOptional, IsBoolean, IsInt, MaxLength } from 'class-validator'

export class CreateRouterDto {
  @IsString()
  @MaxLength(255)
  name: string

  @IsString()
  @MaxLength(255)
  path: string

  @IsOptional() // title 是可选的
  @IsString()
  @MaxLength(255)
  title?: string

  @IsBoolean()
  requiresAuth: boolean

  @IsOptional()
  @IsString()
  @MaxLength(255)
  icon?: string

  @IsOptional()
  @IsString()
  @MaxLength(50)
  menuType?: string

  @IsBoolean()
  keepAlive: boolean

  @IsOptional()
  @IsString()
  @MaxLength(255)
  componentPath?: string

  @IsOptional()
  @IsInt()
  id?: number

  @IsOptional()
  @IsInt()
  pid?: number
}
